﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserBackGround_CheckInfo : System.Web.UI.Page
{
    Operation operation = new Operation(); //业务类对象
    static string userid;
    static string Em;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Admin"] == null)
            {
                WebMessageBox.Show("会话失效，请重新登录！");
            }
            else
            {
                userid = Request.QueryString["id"].ToString();
                BindData(userid);
            }
        }
    }
    /// <summary>
    /// 绑定供求信息到GridViev控件
    /// </summary>
    /// <param name="type">供求信息类别</param>
    private void BindData(string uid)
    {
        DataSet ds = operation.SelectUserInfo(uid);
        type.Text = ds.Tables[0].Rows[0][3].ToString();
        name.Text = ds.Tables[0].Rows[0][1].ToString();
        //password = ds.Tables[0].Rows[0][2];

        tel.Text = ds.Tables[0].Rows[0][5].ToString();
        email.Text = ds.Tables[0].Rows[0][4].ToString();
        qq.Text = ds.Tables[0].Rows[0][6].ToString();
        msn.Text = ds.Tables[0].Rows[0][7].ToString();
        regtime.Text = ds.Tables[0].Rows[0][8].ToString();
        lbComname2.Text = ds.Tables[0].Rows[0][10].ToString();
        lbAddress2.Text = ds.Tables[0].Rows[0][11].ToString();
        lbOrgDetail2.Text = ds.Tables[0].Rows[0][12].ToString();
        if (type.Text.Equals("企业用户"))
        {
            lbAddress.Text = "企业地址:";
            lbComname.Text = "企业名称:";
            lbOrgDetail.Text = "企业简介:";
        }
        else if (type.Text.Equals("科研机构"))
        {
            lbAddress.Text = "机构地址:";
            lbComname.Text = "机构名称:";
            lbOrgDetail.Text = "机构简介:";
        }
        else
        {
            lbAddress.Text = "住址:";
            lbComname.Visible = false;
            lbComname2.Visible = false;
            lbOrgDetail.Text = "个人简介:";
        }
        Em = email.Text;
    }
}